package micro.beauty.order.feign;

import micro.beauty.common.core.ResponseData;
import micro.beauty.common.core.ResponseUtil;
import micro.beauty.order.dto.OrderResponseDTO;
import micro.beauty.order.service.OrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
* @Author:         Liuliya
* @CreateDate:     2020/10/15 23:22
*/
@RestController
public class OrderFeignClient implements IOrderFeignClient{

    @Autowired
    OrderService orderService;

    @Override
    @GetMapping(API_PREFIX + "/list")
    public ResponseData list() {
        List<OrderResponseDTO> ret = orderService.findList();
        return new ResponseUtil<>().data(ret);
    }
}
